package net.bw.realtime.tmall.mapper;

import net.bw.realtime.tmall.bean.SaleTopCityReport;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/*
 * @ Author：liuyawei
 * @ Date：2025-05-28
 */
public interface SaleTopCityStatsMapper {

    @Select("SELECT\n" +
            " city,\n" +
            " sum(total_amount) AS sale_amount,\n" +
            " rank() OVER (ORDER BY sum(total_amount) DESC) AS rank\n" +
            "FROM jtp_tmall_report.dws_area_daily_report\n" +
            "WHERE toDate(window_start_time) = #{date}\n" +
            "GROUP BY city\n" +
            "LIMIT 10")
    List<SaleTopCityReport> selectSaleAmount(String date);

}
